/*
 * Copyright (c) 2025, 大连理工大学 (Dalian University of Technology)
 *
 * Licensed under the Mulan PSL v2.
 * You can use this file according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of the License at
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SEE THE MULAN PSL v2
 * FOR MORE DETAILS.
 */

/*
 * @Author: qiulin 1746365080@qq.com
 * @Date: 2024-11-03 17:11:45
 * @LastEditors: qiulin 1746365080@qq.com
 * @LastEditTime: 2024-12-06 21:19:59
 * @FilePath: /SGSim/DBManager/Repository/HDF5/Input/PARAMETER/NLPARMRepository.h
 */
#pragma once

#include "DBManager/IRepository/Input/Parameter/INLPARMRepository.h"
#include "DBManager/Repository/HDF5/Base/SingleRepositoryBase.h"

template <>
inline HighFive::DataType HighFive::create_datatype<SG::DataStructure::FEM::NLPARMData> ()
{
    HighFive::CompoundType compoundType = { { "SID", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "NINC", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "DT", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "KMETHOD", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "KSTEP", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "MAXITER", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "CONV", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "INTOUT", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "EPSU", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "EPSP", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "EPSW", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "MAXDIV", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "MAXQN", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "MAXLS", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "FSTRESS", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "LSTOL", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "MAXBIS", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "MAXR", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "RTOLB", HighFive::create_datatype<SG::DataStructure::Common::Real> () },
                                            { "MINITER", HighFive::create_datatype<SG::DataStructure::Common::I64> () },
                                            { "DOMAIN_ID", HighFive::create_datatype<SG::DataStructure::Common::Id> () } };
    return compoundType;
}

SG_DBMANAGER_HDF5_NAMESPACE_OPEN

class DBManager_DECLSPEC NLPARMRepository : public INLPARMRepository, public SingleRepositoryBase<SG::DataStructure::FEM::NLPARMData>
{
  public:
    explicit NLPARMRepository (HDF5Database& database);

    void InitialDatasetInfo () override;
};

SG_DBMANAGER_HDF5_NAMESPACE_CLOSE